package com.feng.extra;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
//监听ApplicationEvent类型的事件
public class MyApplicationListener implements ApplicationListener<ApplicationEvent> {
    //当容器中发布该事件时会触发
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        System.out.println("正在监听"+event+" 事件");
    }
}
